Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
node-sass-once-importer
Advanced tools
Import files only once. If the same file is imported in multiple @import
statements, this package will ignore subsequent imports of the same file.
const sass = require('node-sass');
const onceImporter = require('node-sass-once-importer');
sass.render({
...
importer: onceImporter()
...
});
// Example:
@import 'style1.scss';
@import 'style1.scss';
@import 'style2.scss';
// Contents of style1.scss:
.selector1 { }
.selector2 { }
// Contents of style2.scss:
.selector3 { }
.selector4 { }
// webpack.config.js
const onceImporter = require('node-sass-once-importer');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader'
},
{
loader: 'sass-loader',
options: {
sassOptions: {
importer: onceImporter()
}
}
}
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'style.css'
})
]
}
node-sass --importer node_modules/node-sass-once-importer/dist/cli.js -o dist src/index.scss
This module is maintained in one repository together with multiple other node-sass custom importers. The node-sass-magic-importer repository is using a monorepo approach with fixed versions for all packages. The projects maintained in the node-sass-magic-importer monorepo started out as separate repositories with separate versioning, so when they were integrated into the monorepo, the versions of all projects were raised to 5.0.0 and are in sync since then.
This module is powered by node-sass-magic-importer.
Markus Oberlehner
Website: https://markus.oberlehner.net
Twitter: https://twitter.com/MaOberlehner
PayPal.me: https://paypal.me/maoberlehner
Patreon: https://www.patreon.com/maoberlehner
MIT
FAQs
Custom importer for node-sass to import files only once
The npm package node-sass-once-importer receives a total of 4,459 weekly downloads. As such, node-sass-once-importer popularity was classified as popular.
We found that node-sass-once-importer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.